package com.boot.ys.mybatisplus.controller;


import com.baomidou.mybatisplus.extension.api.R;
import com.boot.ys.mybatisplus.entity.TPhoneResultEntity;
import com.boot.ys.mybatisplus.result.Result;
import com.boot.ys.mybatisplus.service.TPhoneService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Yang Sheng
 * @since 2021-12-13
 */
@RestController
@RequestMapping("/api")
public class TPhoneController {

    @Autowired
    private TPhoneService tPhoneService;

    @PostMapping("getPhoneList")
    @ApiOperation("获取手机列表")
    public Result getPhoneList(){
        List<TPhoneResultEntity> phoneList = tPhoneService.getPhoneList();
        return Result.ok(phoneList);
    }

}
